package com.lfy.websocket.handler;

import com.lfy.modules.common.custom.constants.Constants;
import com.lfy.modules.common.utils.ThreadMdcUtil;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.MDC;

import java.util.UUID;


@Slf4j
public class NettyCollectorHandler extends ChannelInboundHandlerAdapter {
    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {

        MDC.put(Constants.TRACE_ID, ThreadMdcUtil.buildTraceId());


        ctx.fireChannelRead(msg);
    }
}
